import mongoose from 'mongoose'
import config from '../../config'
import autoIncrement from 'mongoose-auto-increment'
let Schema = mongoose.Schema

const termsSchema = new mongoose.Schema({
	 _id: Number,
  terms_type: { type: String, default: 'normal' },
  terms_name: { type: String , required: true},
  terms_subtitle: {type: String},
  terms_create_time: {type: Date,default: Date.now},
  terms_enable_time: {type: Date,default: Date.now},
  terms_disable_time: {type: Date,default: Date.now},
  terms_enable: {type: Boolean,default:true},
  terms_answers_enable: {type: Boolean,default:true},
  terms_random_enable: {type: Boolean,default:true},
  terms_rank_enable: {type: Boolean,default:true}

})

termsSchema.plugin(autoIncrement.plugin, 'terms');

termsSchema.methods.method1 = function method1 (password) {
  // console.log('~/src/models/terms.js----这里是处理一些业务逻辑层的数据')

  return 'console 方法已经执行'
}


export default mongoose.model('terms', termsSchema)
